<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2019/5/8
  Time: 12:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="javabean.Userbean" %>
<%@ page errorPage="error.jsp" %>
<jsp:useBean id="u1" class="javabean.Userbean" scope="session"/>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>个人信息</title>
    <style type="text/css">
        body
        {
            background-image: url(2.jpg);
            background-repeat: no-repeat;
            background-size: 1550px 800px;
            background-attachment: fixed;
        }
        .div
        {
            border: 1px solid;
            border-radius: 10px 10px 10px 10px;
            width: 1000px;
            height: 700px;
            margin: 0 auto;
            background-color:white;
            opacity: 0.8;
        }
        .div1
        {
            height: 920px;
            width: 270px;
            float: left;
            margin-top: 20px;
            text-align: center;
        }
        .div2
        {
            font-size: 18px;
            font-weight: bold;
            text-align: center;
            width: 700px;
            height: 40px;
            float: left;
            margin-top: 15px;
            margin-bottom: 10px;
        }
        .img
        {
            border: 1px solid #ccc;
            border-radius: 50%;
        }
        .div3
        {
            width: 300px;
            height: 150px;
            float: left;
        }
        .div4
        {
            width: 300px;
            height: 150px;
            margin-right: 50px;
            float: right;
        }
        .div5
        {
            width: 700px;
            height: 50px;
            float: left;

        }
        .i1
        {
            padding: 2px 0 5px 6px;

        }
        .i2
        {
            padding: 2px 0 5px 6px;
            width: 300px;
        }
        .sub1
        {
            width: 310px;
            height: 30px;
            color: white;
            background-color:gray;
            border: none;
        }
        .f
        {
            opacity: 0;
            height: 0px;
        }
        .i3
        {
            background-color: white;
            border: none;
            opacity:0.8;
            color: #00b6ff;
            font-size: 15px;
        }
        .d1
        {
            float: right;
            font-weight: normal;
        }
        a
        {
            text-decoration: none;
            color: #00b6ff;
        }
    </style>
</head>
<body>
<%
    String username = "";
    String surname = "";
    String name = "";
    String email = "";
    String phone = "";
    String image = "null";
    if(session.getAttribute("users")!=null)
    {
        u1 = (Userbean) session.getAttribute("users");
        u1.show();
        if(!u1.getUsername().equals("null"))
            username = u1.getUsername();
        if(!u1.getSurname().equals("null"))
            surname = u1.getSurname();
        if(!u1.getName().equals("null"))
            name = u1.getName();
        if(!u1.getEmail().equals("null"))
            email = u1.getEmail();
        if(!u1.getPhone().equals("null"))
            phone = u1.getPhone();
        u1.imageexist();
        image = u1.getImage();
    }
%>
<div class="div">
        <div class="div1">
            <form action="/upload" enctype="multipart/form-data" method="post">
                <div>
                    <a href="" title="更换头像">
                        <input type="file" id="picture" class="f" name="images" required="required">
                        <label for="picture">
                            <img class="img" src="/image/<%=image%>" width="120" height="120" alt="头像">
                        </label>
                    </a>
                </div>
                <div style="padding-top: 10px"><input type="submit" name="uploadImage" class="i3" value="保存头像"></div>
            </form>
        </div>
        <form action="/Change" method="post">
        <div class="div2">
            个人信息
            <div class="d1"><a href="/exit">退出</a></div>
            <br>
            <hr>
        </div>
        <div class="div3">
            姓
            <br>
            <input type="text" name="surname" class="i1" value=<%=surname%>>
        </div>
        <div class="div4">
            名
            <br>
            <input type="text" name="name" class="i1" value=<%=name%>>
        </div>
        <div class="div3">
            用户名
            <br>
            <input type="text" name="username" class="i2" readonly="readonly" value=<%=username%>>
        </div>
        <div class="div4">
            邮箱
            <br>
            <input type="text" name="email" class="i2" value=<%=email%>>
        </div>
        <div class="div3">
            手机号
            <br>
            <input type="text" name="phone" class="i2" value=<%=phone%>>
        </div>
        <div class="div5">
            <input type="submit" name="submit" class="sub1" value="保存">
        </div>
    </form>
</div>
</body>
</html>
